home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 52 / Amiga Format AFCD52 (Issue 136, May 2000).iso / -serious- / programming / c / roboticsdp / install < prev    next >
Text File  |  2000-02-28  |  16KB  |  428 lines

  1. ;-----------------------------------------------------------------------------
  2. ; TITLE        : Install
  3. ; VERSION      : 1.0
  4. ; DATE         : 24.02.2000
  5. ; DESCRIPTION  : Installer script for Robotics Developer Pack.
  6. ; INPUT        : -
  7. ; OUTPUT       : -
  8. ;-----------------------------------------------------------------------------
  9. ; MODIFICATIONS: -
  10. ;-----------------------------------------------------------------------------
  11. ; LIMITATIONS AND BUGS
  12. ; <päiväys>
  13. ; <kuvaus>
  14. ;-----------------------------------------------------------------------------
  15.  
  16. ; $VER: Install 1.0 (24.02.2000)
  17.  
  18. ;-----------------------------------------------------------------------------
  19. ; VARIABLES VARIABLES VARIABLES VARIABLES VARIABLES VARIABLES VARIABLES VARIA
  20. ;-----------------------------------------------------------------------------
  21. (set #installer_ver 44)                      ; Minimum Installer version
  22. (set #installer_rev #?)                      ; Minimum Installer revision
  23. (set #application "Robotics Developer Pack") ; Application
  24. (set #packagedir "Work:")                    ; Default directory for software package
  25.  
  26. ;-----------------------------------------------------------------------------
  27. ; Default language (English)
  28. ;-----------------------------------------------------------------------------
  29. (set #string1 ("\nInstaller version %ld.%ld required.\nPlease check your configuration." #installer_ver #installer_rev))
  30. (set #string2 ("\n%s\n\nCopyright © 2000 Janne Peräaho.\All Rights Reserved." #application))
  31. (set #string3 ("\n%s has now been installed." #application))
  32. ;-----------------------------------------------------------------------------
  33. ; Strings: Installation options
  34. ;-----------------------------------------------------------------------------
  35. (set #string5 "\nSelect components to be installed:")
  36. (set #string50 "INSTALLATION OPTIONS\n\nRobotics Developer Pack is divided into 7 parts. You may choose the parts you like to install.")
  37. (set #string51 "Library                   (  7 kB)")
  38. (set #string52 "Example programs          (151 kB)")
  39. (set #string53 "C/C++ include files       ( 25 kB)")
  40. (set #string54 "User documents            ( 12 kB)")
  41. (set #string55 "Developer documents       ( 52 kB)")
  42. (set #string56 "Library's history         (  3 kB)")
  43. (set #string57 "Mini SSC II documentation (563 kB)")
  44. ;-----------------------------------------------------------------------------
  45. ; Strings: Library installation
  46. ;-----------------------------------------------------------------------------
  47. (set #string6 "LIBRARY INSTALLATION\nSelect directory for minissc library.")
  48. (set #string61 "LIBRARY INSTALLATION\n\nThis part will install the minissc.library in the selected target directory.")
  49. (set #string62 "LIBS:")
  50. (set #string7 "\nCopying minissc.library...")
  51. (set #string71 "")
  52. (set #string72 "Libs")
  53. (set #string73 "minissc.library")
  54. ;-----------------------------------------------------------------------------
  55. ; Strings: Example programs installation
  56. ;-----------------------------------------------------------------------------
  57. ; Copy examples drawer
  58. (set #string8 "EXAMPLE PROGRAMS INSTALLATION\nSelect directory for RoboticsDP package. Directory 'RoboticsDP' will be created if it does not exists.")
  59. (set #string81 "EXAMPLE PROGRAMS INSTALLATION\n\nThis part will install the minissc demonstration programs. The 'RoboticDP' directory will be created in the selected target directory and example programs will be copied inside the directory.")
  60. (set #string82 "")
  61. (set #string9 "\nCopying example programs...")
  62. (set #string91 "")
  63. (set #string92 "")
  64. (set #string93 "Examples#?")
  65. ; Copy RoboticsDP drawer icon
  66. (set #string94 "\nCopying RoboticsDP icon...")
  67. (set #string95 "/")
  68. (set #string96 "RoboticsDP.info")
  69. ;-----------------------------------------------------------------------------
  70. ; Strings: C/C++ include files installation
  71. ;-----------------------------------------------------------------------------
  72. (set #stringA "C/C++ INCLUDE FILES INSTALLATION\nSelect include directory for minissc include files.")
  73. (set #stringA1 "C/C++ INCLUDE FILES INSTALLATION\n\nThis part will install C/C++ include files. Select your C/C++ compiler's 'Include' directory as a target directory.")
  74. (set #stringA2 "StormC:Include")
  75. (set #stringB "\nCopying include files...")
  76. (set #stringB1 "")
  77. (set #stringB2 "Include")
  78. (set #stringB3 "#?")
  79. ;-----------------------------------------------------------------------------
  80. ; Strings: User documentation installation
  81. ;-----------------------------------------------------------------------------
  82. (set #stringC "USER DOCUMENTATION INSTALLATION\nSelect directory for RoboticsDP package. Directory 'RoboticsDP' will be created if it does not exists.")
  83. (set #stringC1 "USER DOCUMENTATION INSTALLATION\n\nThis part will install the minissc user documentation. The 'RoboticDP' directory will be created in the selected target directory and documentation will be copied inside the directory.")
  84. (set #stringC2 "")
  85. (set #stringD "\nCopying user documentation...")
  86. (set #stringD1 "")
  87. (set #stringD2 "Docs")
  88. (set #stringD3 "RoboticsDP.guide#?")
  89. ; Copy RoboticsDP drawer icon
  90. (set #stringD4 "\nCopying RoboticsDP icon...")
  91. (set #stringD5 "/")
  92. (set #stringD6 "RoboticsDP.info")
  93. ; Copy Docs drawer icon
  94. (set #stringD7 "\nCopying Docs icon...")
  95. (set #stringD8 "")
  96. (set #stringD9 "Docs.info")
  97. ;-----------------------------------------------------------------------------
  98. ; Strings: Developer documentation installation
  99. ;-----------------------------------------------------------------------------
  100. (set #stringE "DEVELOPER DOCUMENTATION INSTALLATION\nSelect directory for RoboticsDP package. Directory 'RoboticsDP' will be created if it does not exists.")
  101. (set #stringE1 "DEVELOPER DOCUMENTATION INSTALLATION\n\nThis part will install the minissc developer documentation. The 'RoboticDP' directory will be created in the selected target directory and documentation will be copied inside the directory.")
  102. (set #stringE2 "")
  103. (set #stringF "\nCopying developer documentation...")
  104. (set #stringF1 "")
  105. (set #stringF2 "Docs")
  106. (set #stringF3 "CodingConventions.guide#?")
  107. ; Copy RoboticsDP drawer icon
  108. (set #stringF4 "\nCopying RoboticsDP icon...")
  109. (set #stringF5 "/")
  110. (set #stringF6 "RoboticsDP.info")
  111. ; Copy Docs drawer icon
  112. (set #stringF7 "\nCopying Docs icon...")
  113. (set #stringF8 "")
  114. (set #stringF9 "Docs.info")
  115. ; Copy autodocs
  116. (set #stringFA "\nCopying autodocs...")
  117. (set #stringFB "")
  118. (set #stringFC "Autodocs#?")
  119. ;-----------------------------------------------------------------------------
  120. ; Strings: Library's history installation
  121. ;-----------------------------------------------------------------------------
  122. (set #stringG "LIBRARY'S HISTORY INSTALLATION\nSelect directory for RoboticsDP package. Directory 'RoboticsDP' will be created if it does not exists.")
  123. (set #stringG1 "LIBRARY'S HISTORY INSTALLATION\n\nThis part will install the minissc history file. The 'RoboticDP' directory will be created in the selected target directory and history file will be copied inside the directory.")
  124. (set #stringG2 "")
  125. (set #stringH "\nCopying history file...")
  126. (set #stringH1 "")
  127. (set #stringH2 "Docs")
  128. (set #stringH3 "History#?")
  129. ; Copy RoboticsDP drawer icon
  130. (set #stringH4 "\nCopying RoboticsDP icon...")
  131. (set #stringH5 "/")
  132. (set #stringH6 "RoboticsDP.info")
  133. ; Copy Docs drawer icon
  134. (set #stringH7 "\nCopying Docs icon...")
  135. (set #stringH8 "")
  136. (set #stringH9 "Docs.info")
  137. ;-----------------------------------------------------------------------------
  138. ; Strings: Mini SSC II documentation installation
  139. ;-----------------------------------------------------------------------------
  140. (set #stringI "MINI SSC II DOCUMENTATION INSTALLATION\nSelect directory for RoboticsDP package. Directory 'RoboticsDP' will be created if it does not exists.")
  141. (set #stringI1 "MINI SSC II DOCUMENTATION INSTALLATION\n\nThis part will install the Mini SSC II documentation. The 'RoboticDP' directory will be created in the selected target directory and documentation will be copied inside the directory.")
  142. (set #stringI2 "")
  143. (set #stringJ "\nCopying Mini SSC II documentation...")
  144. (set #stringJ1 "")
  145. (set #stringJ2 "Docs")
  146. (set #stringJ3 "Mini SSC II#?")
  147. ; Copy RoboticsDP drawer icon
  148. (set #stringJ4 "\nCopying RoboticsDP icon...")
  149. (set #stringJ5 "/")
  150. (set #stringJ6 "RoboticsDP.info")
  151. ; Copy Docs drawer icon
  152. (set #stringJ7 "\nCopying Docs icon...")
  153. (set #stringJ8 "")
  154. (set #stringJ9 "Docs.info")
  155.  
  156. ;-----------------------------------------------------------------------------
  157. ; SUBROUTINES SUBROUTINES SUBROUTINES SUBROUTINES SUBROUTINES SUBROUTINES SUB
  158. ;-----------------------------------------------------------------------------
  159. ;-----------------------------------------------------------------------------
  160. ; TITLE        : p_DecodeVersion
  161. ; VERSION      : 0.10
  162. ; DATE         : 30.08.1998
  163. ; DESCRIPTION  : Get version and revision from raw version number
  164. ; INPUT        : #version - raw version number
  165. ; OUTPUT       : #ver     - version number
  166. ;                #rev     - revision number
  167. ;-----------------------------------------------------------------------------
  168. ; MODIFICATIONS: -
  169. ;-----------------------------------------------------------------------------
  170. (procedure p_DecodeVersion #version
  171.    (set #ver (/ #version 65536))
  172.    (set #rev (- #version (* #ver 65536)))
  173. )
  174.  
  175. ;-----------------------------------------------------------------------------
  176. ; TITLE        : p_EncodeVersion
  177. ; VERSION      : 0.10
  178. ; DATE         : 30.08.1998
  179. ; DESCRIPTION  : Create raw version number from version and revision number
  180. ; INPUT        : #ver     - version number
  181. ;                #rev     - revision number
  182. ; OUTPUT       : #version - raw version number
  183. ;-----------------------------------------------------------------------------
  184. ; MODIFICATIONS: -
  185. ;-----------------------------------------------------------------------------
  186. (procedure p_EncodeVersion #ver #rev
  187.    (set #version (+ (* #ver 65536) #rev))
  188. )
  189.  
  190. ;-----------------------------------------------------------------------------
  191. ; TITLE        : p_GetDestination
  192. ; VERSION      : 0.10
  193. ; DATE         : 30.08.1998
  194. ; DESCRIPTION  : Get destination directory
  195. ; INPUT        : -
  196. ; OUTPUT       : @default-dest
  197. ;-----------------------------------------------------------------------------
  198. ; MODIFICATIONS: -
  199. ;-----------------------------------------------------------------------------
  200. (procedure p_GetDestination #d1string #d2string #d3string
  201.  
  202.    (set @default-dest
  203.       (askdir
  204.          (prompt #d1string)
  205.          (help #d2string)
  206.          (default #d3string)
  207.          (disk)
  208.       ); askdir
  209.    )
  210. ); p_GetDestination
  211.  
  212. ;-----------------------------------------------------------------------------
  213. ; TITLE        : p_CopyFiles
  214. ; VERSION      : 0.10
  215. ; DATE         : 30.08.1998
  216. ; DESCRIPTION  : Copy files
  217. ; INPUT        : -
  218. ; OUTPUT       : -
  219. ;-----------------------------------------------------------------------------
  220. ; MODIFICATIONS: -
  221. ;-----------------------------------------------------------------------------
  222. (procedure p_CopyFiles #c1string #c2string #c3string #c4string
  223.  
  224.    (copyfiles
  225.       (prompt #c1string)
  226.       (help #c2string)
  227.       (source #c3string)
  228.       (dest @default-dest)
  229.       (pattern #c4string)
  230.       (optional "force")
  231.    ); copyfiles
  232.  
  233. ); p_CopyFiles
  234.  
  235. ;-----------------------------------------------------------------------------
  236. ; MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN
  237. ;-----------------------------------------------------------------------------
  238. ; Welcome message
  239. (welcome #string2)
  240.  
  241. ; Check Installer version
  242. (p_EncodeVersion #installer_ver #installer_rev)
  243. (if (< @installer-version #version)
  244.    (
  245.       (exit #string1 (quiet))
  246.    )
  247. ); if
  248.  
  249. ; Open new screen for installer
  250. (effect "center" "horizontal" $000000 $000000)
  251.  
  252. ; Open background picture
  253. (showmedia "#coverpic" "Installer/Cover.iff" "center" "none" 0)
  254.  
  255. ; Ask install options
  256. (set #installoptions
  257.    (askoptions
  258.       (prompt #string5)
  259.       (help #string50)
  260.       (choices #string51 #string52 #string53 #string54 #string55 #string56 #string57)
  261.       (default %1111111)
  262.    ); askoptions
  263. )
  264.  
  265. ; 0% done
  266. (complete 0)
  267.  
  268. ; 1st option (#string51) - Library
  269. (if (in #installoptions 0)
  270.    (
  271.       ; Get destination directory
  272.       (p_GetDestination #string6 #string61 #string62)
  273.  
  274.       ; Copy files
  275.       (p_CopyFiles #string7 #string71 #string72 #string73)
  276.    )
  277. ); if
  278.  
  279. ; 14% done
  280. (complete 14)
  281.  
  282. ; 2nd (#string52) - Examples
  283. (if (in #installoptions 1)
  284.    (
  285.       ; Get destination directory
  286.       (p_GetDestination #string8 #string81 #packagedir)
  287.       (set #packagedir @default-dest) ; Remember directory
  288.  
  289.       ; Copy RoboticsDP drawer icon
  290.       (p_CopyFiles #string9 #string94 #string95 #string96)
  291.  
  292.       ; Set correct target directory for Examples drawer
  293.       (set @default-dest (cat @default-dest "RoboticsDP"))
  294.  
  295.       ; Copy files
  296.       (p_CopyFiles #string9 #string91 #string92 #string93)
  297.    )
  298. ); if
  299.  
  300. ; 28% done
  301. (complete 28)
  302.  
  303. ; 3rd option (#string53) - Includes
  304. (if (in #installoptions 2)
  305.    (
  306.       ; Get destination directory
  307.       (p_GetDestination #stringA #stringA1 #stringA2)
  308.  
  309.       ; Copy files
  310.       (p_CopyFiles #stringB #stringB1 #stringB2 #stringB3)
  311.    )
  312. ); if
  313.  
  314. ; 42% done
  315. (complete 42)
  316.  
  317. ; 4th option (#string54) - User docs
  318. (if (in #installoptions 3)
  319.    (
  320.       ; Get destination directory
  321.       (p_GetDestination #stringC #stringC1 #packagedir)
  322.       (set #packagedir @default-dest) ; Remember directory
  323.  
  324.       ; Copy RoboticsDP drawer icon
  325.       (p_CopyFiles #stringD #stringaD4 #stringD5 #stringD6)
  326.  
  327.       ; Set correct target directory for Docs drawer
  328.       (set @default-dest (cat @default-dest "RoboticsDP"))
  329.  
  330.       ; Copy Docs drawer icon
  331.       (p_CopyFiles #stringD #stringaD7 #stringD8 #stringD9)
  332.  
  333.       ; Set correct target directory for documents
  334.       (set @default-dest (cat @default-dest "/Docs"))
  335.  
  336.       ; Copy files
  337.       (p_CopyFiles #stringD #stringD1 #stringD2 #stringD3)
  338.    )
  339. ); if
  340.  
  341. ; 56% done
  342. (complete 56)
  343.  
  344. ; 5th option (#string55) - Developer docs
  345. (if (in #installoptions 4)
  346.    (
  347.       ; Get destination directory
  348.       (p_GetDestination #stringE #stringE1 #packagedir)
  349.       (set #packagedir @default-dest) ; Remember directory
  350.  
  351.       ; Copy RoboticsDP drawer icon
  352.       (p_CopyFiles #stringF #stringaF4 #stringF5 #stringF6)
  353.  
  354.       ; Set correct target directory for Docs drawer
  355.       (set @default-dest (cat @default-dest "RoboticsDP"))
  356.  
  357.       ; Copy autodocs
  358.       (p_CopyFiles #stringFA #stringF1 #stringFB #stringFC)
  359.  
  360.       ; Copy Docs drawer icon
  361.       (p_CopyFiles #stringF #stringaF7 #stringF8 #stringF9)
  362.  
  363.       ; Set correct target directory for documents
  364.       (set @default-dest (cat @default-dest "/Docs"))
  365.  
  366.       ; Copy docs
  367.       (p_CopyFiles #stringF #stringF1 #stringF2 #stringF3)
  368.    )
  369. ); if
  370.  
  371. ; 60% done
  372. (complete 60)
  373.  
  374. ; 6th option (#string56) - Library's history
  375. (if (in #installoptions 5)
  376.    (
  377.       ; Get destination directory
  378.       (p_GetDestination #stringG #stringG1 #packagedir)
  379.       (set #packagedir @default-dest) ; Remember directory
  380.  
  381.       ; Copy RoboticsDP drawer icon
  382.       (p_CopyFiles #stringH #stringaH4 #stringH5 #stringH6)
  383.  
  384.       ; Set correct target directory for Docs drawer
  385.       (set @default-dest (cat @default-dest "RoboticsDP"))
  386.  
  387.       ; Copy Docs drawer icon
  388.       (p_CopyFiles #stringH #stringaH7 #stringH8 #stringH9)
  389.  
  390.       ; Set correct target directory for history directory
  391.       (set @default-dest (cat @default-dest "/Docs"))
  392.  
  393.       ; Copy history directory
  394.       (p_CopyFiles #stringH #stringH1 #stringH2 #stringH3)
  395.    )
  396. ); if
  397.  
  398. ; 74% done
  399. (complete 74)
  400.  
  401. ; 8th option (#string57) - Mini SSC II docs
  402. (if (in #installoptions 6)
  403.    (
  404.       ; Get destination directory
  405.       (p_GetDestination #stringI #stringI1 #packagedir)
  406.       (set #packagedir @default-dest) ; Remember directory
  407.  
  408.       ; Copy RoboticsDP drawer icon
  409.       (p_CopyFiles #stringJ #stringaJ4 #stringJ5 #stringJ6)
  410.  
  411.       ; Set correct target directory for Docs drawer
  412.       (set @default-dest (cat @default-dest "RoboticsDP"))
  413.  
  414.       ; Copy Docs drawer icon
  415.       (p_CopyFiles #stringJ #stringaJ7 #stringJ8 #stringJ9)
  416.  
  417.       ; Set correct target directory for history directory
  418.       (set @default-dest (cat @default-dest "/Docs"))
  419.  
  420.       ; Copy Mini SSC II docs directory
  421.       (p_CopyFiles #stringJ #stringJ1 #stringJ2 #stringJ3)
  422.    )
  423. ); if
  424.  
  425. ; All done
  426. (complete 100)
  427. (exit #string3 (quiet))
  428.